import { http } from '@/utils/http'

export interface GetCategoryTopItem {
  children: Child[]
  id: string
  imageBanners: string[]
  name: string
  picture: string
}

export interface Child {
  brands: null
  categories: null
  goods: Good[]
  id: string
  name: string
  parentId: null
  parentName: null
  picture: string
  saleProperties: null
}

export interface Good {
  desc: string
  discount: null
  id: string
  name: string
  orderNum: number
  picture: string
  price: string
}

/**
 * 一级分类列表-小程序-APP
 */
export function getCategoryTop() {
  return http<GetCategoryTopItem[]>({
    method: 'GET',
    url: '/category/top',
  })
}
